package main

import (
	"log"
	"tushare/model/mysql"
	"tushare/router"

	"github.com/gin-gonic/gin"
)

func main() {
	mysql.InitDB()
	defer mysql.DB.Close()
	rt := new(router.Router)
	rt.R = gin.Default()

	rt.InitRouter()

	//绑定html模版
	rt.R.LoadHTMLGlob("views/*")
	rt.R.Static("/static", "./static")

	//启动服务
	if err := rt.R.Run(":9080"); err != nil {
		log.Fatal("服务器启动失败...")
	}
}
